<!--
 * @Descripttion: 核酸宝项目前端
 * @version: 
 * @Author: 杜宇轩
 * @Date: 2022-05-22 05:27:34
 * @LastEditors: 杜宇轩
 * @LastEditTime: 2022-05-22 06:22:08
-->
<template>
  <div class="VL_box">
    <div class="VL_box_header">
      <i class="el-icon-menu"/>
      日志信息
    </div>
    <el-table
      class="VL_table"
      :data="tableData"
      min-height="500px"
      :default-sort = "{prop: 'showCreateTime', order: 'descending'}"
      highlight-current-row
      border
      stripe
    >
      <el-table-column
        type="expand"
        label="详细信息"
        width="90"
      >
        <template slot-scope="props">
          <el-form label-position="left" inline class="VL_table_expand">
            <el-form-item label="日志内容">
              <span>{{ props.row.userAction }}</span>
            </el-form-item>
          </el-form>
        </template>
      </el-table-column>
      <el-table-column
        prop="id"
        label="日志编号"
        width="120"
      />
      <el-table-column
        prop="brief"
        label="简略信息"
        min-width="240"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="userId"
        label="用户编号"
        width="300"
      />
      <el-table-column
        prop="showCreateTime"
        label="日志时间"
        width="180"
      />
    </el-table>
  </div>
</template>

<script>
import {
  adminCheckLog
} from '@/api/admin/adminLog';
export default {
  name: 'ViewLog',
  data() {
    return {
      tableData: []
    }
  },
  created() {
    adminCheckLog().then((data) => {
      data.forEach((item) => {
        let str = item.createTime.substr(0, 19);
        str = str.replaceAll('T', ' ');
        item.showCreateTime = str;
        item.brief = item.userAction;
      });
      this.tableData = data;
    });
  },
  methods: {
  }
}
</script>

<style lang="scss">
.VL_box {
  background: #FFFFFF;
  display: inline-block;
  width: calc(100% - 100px);
  min-width: 1000px;
  margin: 50px 50px 0px 50px;
  border-radius: 5px;
  box-shadow: 1px 1px 3px 3px rgba(0,0,0,0.2);

  .VL_box_header {
    background: #EEE;
    padding: 5px;
    border-radius: 5px 5px 0px 0px;
    border-bottom: 1px solid #DDD;
  }

  .VL_table {
    width: calc(100% - 40px);
    margin: 20px 20px 10px 20px;

    .VL_table_expand {
      font-size: 0;
    }
    .VL_table_expand label {
      width: 90px;
      color: #005187;
    }
    .VL_table_expand .el-form-item {
      margin: 0px 0px 0px 10px;
      width: 60%;
    }
  }
}

</style>